﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.Assertions;

public class TestMenu : MonoBehaviour
{
    ///* **************************************************************
    // * Top Menu
    // *
    // **/
    //[MenuItem( "Test/Menu/Print", false, 1 )]
    //static void Print ()
    //{
    //    Debug.Log( "MenuItem Print" );
    //}

    ///*
    // * Context menu
    // **/
    //[MenuItem( "CONTEXT/Transform/Double Size", false, 1 )]
    //static void DoubleSize ( MenuCommand cmd )
    //{
    //    var trans = cmd.context as Transform;
    //    Assert.IsFalse( trans == null );

    //    trans.localScale = new Vector3()
    //    {
    //        x = trans.transform.localScale.x * 2,
    //        y = trans.transform.localScale.y * 2,
    //        z = trans.transform.localScale.z * 2
    //    };
    //}

    ///* **************************************************************
    // * Hierarchy context menu
    // * The first root path is GameObject
    // * Note: false, piority 0.
    // **/
    //[MenuItem( "GameObject/Create New Item", false, 0 )]
    //static void HCMCreateNewItem ()
    //{
    //    Debug.Log( "GameObject/Create/Create New Item" );
    //}

    ///* **************************************************************
    // * Project context menu
    // **/
    //[MenuItem( "Assets/Create/Create New Item" )]
    //static void CreateNewItem ()
    //{
    //    Debug.Log( "Assets/Create/Create New Item" );
    //}

    ///* **************************************************************
    // * Hierarchy
    // *
    // **/
    //[MenuItem( "Test/Menu/Print Selected Object Info" )]
    //static void PrintSelectedGameObjectInfo ()
    //{
    //    var info = string.Empty;
    //    if ( null != Selection.activeGameObject )
    //    {
    //        info = string.Format( "{0}\n{1}", Selection.activeGameObject.name,
    //            Selection.activeGameObject.GetType().ToString() );

    //        Debug.Log( info );
    //    }
    //    else if ( null != Selection.activeObject )
    //    {
    //        info = string.Format( "{0}\n{1}", Selection.activeObject.name,
    //            Selection.activeObject.GetType().ToString() );

    //        Debug.Log( info );
    //    }
    //}

    ///* **************************************************************
    // * Validation
    // *
    // **/
    //[MenuItem( "Assets/PrintScriptName" )]
    //static void PrintScriptName ()
    //{
    //    print( Selection.activeObject.name );
    //}

    //[MenuItem( "Assets/PrintScriptName", true )]
    //static bool PrintScriptNameValidation ()
    //{
    //    return Selection.activeObject.GetType() == typeof( MonoScript );
    //}

}
